% V20210224 - 7.5 GW_ADD_FONT$ % Download font from the web. FILE.EXISTS fe, "BebasNeue.ttf" IF !fe POPUP "Downloading font..." BYTE.OPEN r, fid, "http://mougino.free.fr/tmp/pctl/BebasNeue Regular.ttf" IF fid<0 THEN END "Error accessing http://mougino.free.fr" BYTE.COPY fid, "BebasNeue.ttf" ENDIF % Load the library. INCLUDE "GW.bas" % Create a page. p = GW_NEW_PAGE() % Prepare title bar string. Title$ = GW_ADD_BAR_TITLE$("GW_ADD_FONT$ Example") % Add title to page. GW_ADD_TITLEBAR(p,Title$) % Add descriptive text. GW_ADD_TEXTBOX(p, "The following control is customized with a local True Type Font (.ttf):") % Create customization from local font. myfont$ = GW_ADD_FONT$(p, "BebasNeue.ttf") % Activate a 1-time customization. GW_USE_THEME_CUSTO_ONCE("style='color:blue' font=" + myfont$) % Add customized text. GW_ADD_TEXTBOX(p, "I am a textbox written with the BebasNeue Regular font.") % Show the page. GW_RENDER(p) DO % Wait for user action. r$ = GW_WAIT_ACTION$() % Place here any necessary code to process user actions. % Example feedback. POPUP r$ % End when BACK key is pressed. UNTIL r$ = "BACK" END "End of GW_ADD_FONT$ Example."